const State = {};

// var localStorage;
// var isServer = localStorage != undefined;

// State.isLogined = isServer ? parseInt(localStorage.getItem('isLogined') || 0) : 0;
State.isLogined = 1;

State.login = function (cb) {
    this.isLogined = 1;
    // isServer && localStorage.setItem('isLogined', 1);
    console.log('login');
    alert('abc');
    setTimeout(function () {
        cb && cb();
    }, 1000);
}

State.logout = function (cb) {
    this.isLogined = 0;
    // isServer && localStorage.setItem('isLogined', 0);
    setTimeout(function () {
        cb && cb();
    }, 1000);
}

module.exports = State;